﻿package mvc_view
{
	import flash.display.*;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flash.text.TextField;

	public class RegisterView extends View
	{
		private var _container:MovieClip;

		public function RegisterView(container:MovieClip)
		{
			_container = container;
			
			// default value used for presentation
			_container.reg_avatar_txt.text = "";
			_container.reg_username_txt.text = "Drewmania";
			_container.reg_password_txt.text = "password";
			_container.reg_firstname_txt.text = "Drewan";
			_container.reg_lastname_txt.text = "O'Brien";
			_container.reg_email_txt.text = "drewan@open-records.net";
			_container.reg_dob_txt.text = "20/06/87";
			_container.reg_city_txt.text = "Cairns";
			_container.reg_country_txt.text = "Australia";
			_container.reg_gender_txt.text = "Male"; 
			_container.reg_availability_txt.text = "Yes";
		}

		override public function update(event:Event = null):void
		{
			if (model == null) trace("model null");
			_container.reg_avatar_txt.text = model.selectedPath;
		}
		
		public function setPath(path:String):void
		{
			_container.reg_avatar_txt.text = path;
		}

		public function get username():String
		{
			return _container.reg_username_txt.text;
		}
		
		public function get password():String
		{
			return _container.reg_password_txt.text;
		}

		public function get firstName():String
		{
			return _container.reg_firstname_txt.text;
		}

		public function get lastName():String
		{
			return _container.reg_lastname_txt.text;
		}

		public function get email():String
		{
			return _container.reg_email_txt.text;
		}

		public function get dateOfBirth():String
		{
			return _container.reg_dob_txt.text;
		}

		public function get city():String
		{
			return _container.reg_city_txt.text;
		}

		public function get country():String
		{
			return _container.reg_country_txt.text;
		}

		public function get gender():String
		{
			return _container.reg_gender_txt.text;
		}

		public function get availability():String
		{
			return _container.reg_availability_txt.text;
		}
		
		public function clearAll():void
		{
			_container.reg_avatar_txt.text = "";
			_container.reg_username_txt.text = "";
			_container.reg_password_txt.text = "";
			_container.reg_firstname_txt.text = "";
			_container.reg_lastname_txt.text = "";
			_container.reg_email_txt.text = "";
			_container.reg_dob_txt.text = "";
			_container.reg_city_txt.text = "";
			_container.reg_country_txt.text = "";
			_container.reg_gender_txt.text = ""; 
			_container.reg_availability_txt.text = "";
		}
	}
}